#include <stdio.h>
#include <string.h>

char* longestCommonPrefix(char** strs, int strsSize) {
	char* s = (char*)malloc(201);
	if(strsSize==0)
	{
		return NULL;
	}
	int i,j;
	strcpy(s,strs[0]); 
	for(i=1;i<strsSize;i++){
		for(j=0;strs[i][j]!='\0';j++){
		
			if(s[j]!=strs[i][j]){
				s[j]='\0';
				break;
			}
		}
		s[j]='\0';
	}
	return s;
}
int main()
{
	char *strs[]={
			"flow","flower","flight"
		};
	char *s = longestCommonPrefix(strs, 3);
	printf("%s\n", s);
	return 0;
}
